<template>
    <div>
        <el-upload drag action :auto-upload="false" :on-change="videoSaveToUrl" :accept="'video/*'">
            上传
        </el-upload>
        <span v-on:click="processButtonClick()">上传</span>
    </div>
</template>
  
<script>
import axios from 'axios';
import{ uploadByPieces} from "./fenpian.js"
// 首行缩进插件需单独下载后将下载文件放在plugins下
export default {
    name: "Tinymce",


    data() {
        return {
            baseUrl: "http://buxn.natapp1.cc",
            video: null
        };
    },

    mounted() {
    },
    beforeDestroy() {
    },
    methods: {
        videoSaveToUrl(event) {
            this.video = event.raw;
            // this.processButtonClick()
        },
        processButtonClick() {
            uploadByPieces({
                file: this.video,//视频实体
                pieceSize: 5, //分片大小
                success: data => {
                    console.log(data,"67777")
                    console.log("分片上传视频成功");
                },
                error: e => {
                    console.log(e,"trreee")
                    console.log("分片上传视频失败");
                }
            })
        }
    },
};
</script>
  
<style  scoped></style>
  